#ifndef USERSERVICE_H
#define USERSERVICE_H

#include "userdao.h"
#include <QObject>

class UserService : public QObject
{
    Q_OBJECT
public:
    explicit UserService(Database *db, QObject *parent = nullptr);

    // 获取当前用户信息
    QMap<QString, QVariant> getCurrentUser();

    // 设置当前用户
    void setCurrentUser(const QMap<QString, QVariant> &user);

    // 用户认证
    bool authenticate(const QString &username, const QString &password, int &roleId);

private:
    UserDao *m_userDao;
    QMap<QString, QVariant> m_currentUser;
};

#endif // USERSERVICE_H
